package com.ruoyi.web.controller.activiti;
import com.ruoyi.act.service.ActHistoryService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/act/HistoryController")
public class ActHistoryController {

    @Autowired
    private ActHistoryService actHistoryService;

    @GetMapping("/history")
    public AjaxResult history(@RequestParam(value = "userName",required = false) String userName){
        String param = SecurityUtils.getUsername();
        if(StringUtils.isNotEmpty(userName)){
            param = userName;
        }
        return actHistoryService.history(param);
    };

}
